{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7.0+14.gf4d024d.dirty\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import folium\n",
    "\n",
    "print(folium.__version__)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# How to create Popups\n",
    "\n",
    "## Simple popups\n",
    "\n",
    "You can define your popup at the feature creation, but you can also overwrite them afterwards:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2xlYWZsZXRAMS4zLjQvZGlzdC9sZWFmbGV0LmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2FqYXguZ29vZ2xlYXBpcy5jb20vYWpheC9saWJzL2pxdWVyeS8xLjExLjEvanF1ZXJ5Lm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6Ly9tYXhjZG4uYm9vdHN0cmFwY2RuLmNvbS9ib290c3RyYXAvMy4yLjAvanMvYm9vdHN0cmFwLm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6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heWVyczogW10sCiAgICAgICAgd29ybGRDb3B5SnVtcDogZmFsc2UsCiAgICAgICAgY3JzOiBMLkNSUy5FUFNHMzg1NywKICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICB9KTsKCgogICAgCiAgICB2YXIgdGlsZV9sYXllcl8wNGQ0NjU3ZmJkYjU0NzAyOWFiM2MxZTAyZDYwOGI5MSA9IEwudGlsZUxheWVyKAogICAgICAgICdodHRwczovL3tzfS50aWxlLm9wZW5zdHJlZXRtYXAub3JnL3t6fS97eH0ve3l9LnBuZycsCiAgICAgICAgewogICAgICAgICJhdHRyaWJ1dGlvbiI6IG51bGwsCiAgICAgICAgImRldGVjdFJldGluYSI6IGZhbHNlLAogICAgICAgICJtYXhOYXRpdmVab29tIjogMTgsCiAgICAgICAgIm1heFpvb20iOiAxOCwKICAgICAgICAibWluWm9vbSI6IDAsCiAgICAgICAgIm5vV3JhcCI6IGZhbHNlLAogICAgICAgICJvcGFjaXR5IjogMSwKICAgICAgICAic3ViZG9tYWlucyI6ICJhYmMiLAogICAgICAgICJ0bXMiOiBmYWxzZQp9KS5hZGRUbyhtYXBfMWQ5NWMxMDdmNjc5NDFiNGE3N2NjYTVmMDdkNjYyNTQpOwogICAgCiAgICAgICAgdmFyIG1hcmtlcl8xMzk0NjUzNTkxNDU0OTMyYjZjN2NlMDI0ZTE2ODFhMiA9IEwubWFya2VyKAogICAgICAgICAgICBbNDUsIC0zMF0sCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGljb246IG5ldyBMLkljb24uRGVmYXVsdCgpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICkuYWRkVG8obWFwXzFkOTVjMTA3ZjY3OTQxYjRhNzdjY2E1ZjA3ZDY2MjU0KTsKICAgICAgICAKICAgIAogICAgICAgICAgICB2YXIgcG9wdXBfN2ZlN2UzZDdhYTdkNDQ0ZTgyYjQ1ZTkzOWM5ZWQzYzEgPSBMLnBvcHVwKHttYXhXaWR0aDogJz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UyYjQzMmQ0YWM1ID0gTC5wb3B1cCh7bWF4V2lkdGg6ICcxMDAlJwogICAgICAgICAgICAKICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAKICAgICAgICAgICAgICAgIHZhciBodG1sXzYyYThkMjNkMjhjMjQzZmM5OTVjMzdjY2FjNDE2YzI3ID0gJChgPGRpdiBpZD0iaHRtbF82MmE4ZDIzZDI4YzI0M2ZjOTk1YzM3Y2NhYzQxNmMyNyIgc3R5bGU9IndpZHRoOiAxMDAuMCU7IGhlaWdodDogMTAwLjAlOyI+b3V0bGluZSBQb3B1cCBvbiBHZW9KU09OPC9kaXY+YClbMF07CiAgICAgICAgICAgICAgICBwb3B1cF8xMjZhNjE2NDgwNDk0MTM2YTBmYTQ1MmI0MzJkNGFjNS5zZXRDb250ZW50KGh0bWxfNjJhOGQyM2QyOGMyNDNmYzk5NWMzN2NjYWM0MTZjMjcpOwogICAgICAgICAgICAKCiAgICAgICAgICAgIGdlb19qc29uX2FjZGM5ZGU3NWU0MDQ3YTJhNDQ3NDU5OWQ4ODEyMWM1LmJpbmRQb3B1cChwb3B1cF8xMjZhNjE2NDgwNDk0MTM2YTBmYTQ1MmI0MzJkNGFjNSkKICAgICAgICAgICAgOwoKICAgICAgICAgICAgCiAgICAgICAgCjwvc2NyaXB0Pg==\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7f29efe70358>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = folium.Map([45, 0], zoom_start=4)\n",
    "\n",
    "folium.Marker([45, -30], popup='inline implicit popup').add_to(m)\n",
    "\n",
    "folium.CircleMarker(\n",
    "    location=[45, -10],\n",
    "    radius=25,\n",
    "    fill=True,\n",
    "    popup=folium.Popup('inline explicit Popup')\n",
    ").add_to(m)\n",
    "\n",
    "ls = folium.PolyLine(\n",
    "    locations=[[43, 7], [43, 13], [47, 13], [47, 7], [43, 7]],\n",
    "    color='red'\n",
    ")\n",
    "\n",
    "ls.add_child(folium.Popup('outline Popup on Polyline'))\n",
    "ls.add_to(m)\n",
    "\n",
    "gj = folium.GeoJson(\n",
    "    data={\n",
    "        'type': 'Polygon',\n",
    "        'coordinates': [[[27, 43], [33, 43], [33, 47], [27, 47]]]\n",
    "    }\n",
    ")\n",
    "\n",
    "gj.add_child(folium.Popup('outline Popup on GeoJSON'))\n",
    "gj.add_to(m)\n",
    "\n",
    "m.save(os.path.join('results', 'simple_popups.html'))\n",
    "\n",
    "m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2xlYWZsZXRAMS4zLjQvZGlzdC9sZWFmbGV0LmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2FqYXguZ29vZ2xlYXBpcy5jb20vYWpheC9saWJzL2pxdWVyeS8xLjExLjEvanF1ZXJ5Lm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6Ly9tYXhjZG4uYm9vdHN0cmFwY2RuLmNvbS9ib290c3RyYXAvMy4yLjAvanMvYm9vdHN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AgICB6b29tOiAyLAogICAgICAgIG1heEJvdW5kczogYm91bmRzLAogICAgICAgIGxheWVyczogW10sCiAgICAgICAgd29ybGRDb3B5SnVtcDogZmFsc2UsCiAgICAgICAgY3JzOiBMLkNSUy5FUFNHMzg1NywKICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICB9KTsKCgogICAgCiAgICB2YXIgdGlsZV9sYXllcl85ODBhYThiYjZiZGI0NWI0YjA4NTE4OGFiMGE3NTFjOCA9IEwudGlsZUxheWVyKAogICAgICAgICdodHRwczovL3tzfS50aWxlLm9wZW5zdHJlZXRtYXAub3JnL3t6fS97eH0ve3l9LnBuZycsCiAgICAgICAgewogICAgICAgICJhdHRyaWJ1dGlvbiI6IG51bGwsCiAgICAgICAgImRldGVjdFJldGluYSI6IGZhbHNlLAogICAgICAgICJtYXhOYXRpdmVab29tIjogMTgsCiAgICAgICAgIm1heFpvb20iOiAxOCwKICAgICAgICAibWluWm9vbSI6IDAsCiAgICAgICAgIm5vV3JhcCI6IGZhbHNlLAogICAgICAgICJvcGFjaXR5IjogMSwKICAgICAgICAic3ViZG9tYWlucyI6ICJhYmMiLAogICAgICAgICJ0bXMiOiBmYWxzZQp9KS5hZGRUbyhtYXBfZWVkM2E4MzJkODRjNDY4MzhhODVmMDZhZDkxNzNiZTMpOwogICAgCiAgICAgICAgdmFyIG1hcmtlcl83MjM5MWQ2ZGNiZjM0YTYwYmM1NzM5YWEzMTAwNDQ0MCA9IEwubWFya2VyKAogICAgICAgICAgICBbNDUsIC0xMF0sCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGljb246IG5ldyBMLkljb24uRGVmYXVsdCgpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICkuYWRkVG8obWFwX2VlZDNhODMyZDg0YzQ2ODM4YTg1ZjA2YWQ5MTczYmUzKTsKICAgICAgICAKICAgIAogICAgICAgICAgICB2YXIgcG9wdXBfYTIxZWMzM2E2M2VhNDVkY2JkNzkwMDI4N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aWR0aDogJzEwMCUnCiAgICAgICAgICAgIAogICAgICAgICAgICB9KTsKCiAgICAgICAgICAgIAogICAgICAgICAgICAgICAgdmFyIGh0bWxfNDAxYjVmZTg4Y2MxNGQ3ZTljNTgwODdkY2QyZGUwNDQgPSAkKGA8ZGl2IGlkPSJodG1sXzQwMWI1ZmU4OGNjMTRkN2U5YzU4MDg3ZGNkMmRlMDQ0IiBzdHlsZT0id2lkdGg6IDEwMC4wJTsgaGVpZ2h0OiAxMDAuMCU7Ij7Dh2EgYyYjMzk7ZXN0IGNob3VldHRlPC9kaXY+YClbMF07CiAgICAgICAgICAgICAgICBwb3B1cF9jZDllMGQ5NDBhNTI0M2NkOWNlMWYwOTZhNTU3YjA4Ni5zZXRDb250ZW50KGh0bWxfNDAxYjVmZTg4Y2MxNGQ3ZTljNTgwODdkY2QyZGUwNDQpOwogICAgICAgICAgICAKCiAgICAgICAgICAgIG1hcmtlcl81ZWRlODFlNTlhYjE0ODA5YjczOGY2ODU3OWI3Zjk0YS5iaW5kUG9wdXAocG9wdXBfY2Q5ZTBkOTQwYTUyNDNjZDljZTFmMDk2YTU1N2IwODYpCiAgICAgICAgICAgIDsKCiAgICAgICAgICAgIAogICAgICAgIAo8L3NjcmlwdD4=\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7f29efeb9b38>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = folium.Map([45, 0], zoom_start=2)\n",
    "\n",
    "folium.Marker(\n",
    "    location=[45, -10],\n",
    "    popup=folium.Popup(\"Let's try quotes\", parse_html=True, max_width=100)\n",
    ").add_to(m)\n",
    "\n",
    "folium.Marker(\n",
    "    location=[45, -30],\n",
    "    popup=folium.Popup(u\"Ça c'est chouette\", parse_html=True, max_width='100%')\n",
    ").add_to(m)\n",
    "\n",
    "m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Vega Popup\n",
    "\n",
    "You may know that it's possible to create awesome Vega charts with (or without) `vincent`. If you're willing to put one inside a popup, it's possible thanks to `folium.Vega`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "import numpy as np\n",
    "import vincent\n",
    "\n",
    "scatter_points = {\n",
    "    'x': np.random.uniform(size=(100,)),\n",
    "    'y': np.random.uniform(size=(100,)),\n",
    "}\n",
    "\n",
    "# Let's create the vincent chart.\n",
    "scatter_chart = vincent.Scatter(scatter_points,\n",
    "                                iter_idx='x',\n",
    "                                width=600,\n",
    "                                height=300)\n",
    "\n",
    "# Let's convert it to JSON.\n",
    "scatter_json = scatter_chart.to_json()\n",
    "\n",
    "# Let's convert it to dict.\n",
    "scatter_dict = json.loads(scatter_json)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2xlYWZsZXRAMS4zLjQvZGlzdC9sZWFmbGV0LmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2NvZGUuanF1ZXJ5LmNvbS9qcXVlcnktMi4xLjAubWluLmp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ogICAgCiAgICAgICAgdmFyIGJvdW5kcyA9IG51bGw7CiAgICAKCiAgICB2YXIgbWFwXzYyYjU0NjM2MjM3OTRkOTU4OWYzMGFhMDNlZTIyMzU5ID0gTC5tYXAoCiAgICAgICAgJ21hcF82MmI1NDYzNjIzNzk0ZDk1ODlmMzBhYTAzZWUyMjM1OScsIHsKICAgICAgICBjZW50ZXI6IFs0MywgLTEwMF0sCiAgICAgICAgem9vbTogNCwKICAgICAgICBtYXhCb3VuZHM6IGJvdW5kcywKICAgICAgICBsYXllcnM6IFtdLAogICAgICAgIHdvcmxkQ29weUp1bXA6IGZhbHNlLAogICAgICAgIGNyczogTC5DUlMuRVBTRzM4NTcsCiAgICAgICAgem9vbUNvbnRyb2w6IHRydWUsCiAgICAgICAgfSk7CgoKICAgIAogICAgdmFyIHRpbGVfbGF5ZXJfNDlhMmRjOTgwZGE2NGMwN2JjYzkyMzdjMDU0ZTNmOTAgPSBMLnRpbGVMYXllcigKICAgICAgICAnaHR0cHM6Ly97c30udGlsZS5vcGVuc3RyZWV0bWFwLm9yZy97en0ve3h9L3t5fS5wbmcnLAogICAgICAgIHsKICAgICAgICAiYXR0cmlidXRpb24iOiBudWxsLAogICAgICAgICJkZXRlY3RSZXRpbmEiOiBmYWxzZSwKICAgICAgICAibWF4TmF0aXZlWm9vbSI6IDE4LAogICAgICAgICJtYXhab29tIjogMTgsCiAgICAgICAgIm1pblpvb20iOiAwLAogICAgICAgICJub1dyYXAiOiBmYWxzZSwKICAgICAgICAib3BhY2l0eSI6IDEsCiAgICAgICAgInN1YmRvbWFpbnMiOiAiYWJjIiwKICAgICAgICAidG1zIjogZmFsc2UKfSkuYWRkVG8obWFwXzYyYjU0NjM2MjM3OTRkOTU4OWYzMGFhMDNlZTIyMzU5KTsKICAgIAogICAgICAgIHZhciBtYXJrZXJfZmJhNTMwYTYyM2E1NGNhZTliMTEyZTg4MzY2Y2E0ODUgPSBMLm1hcmtlcigKICAgICAgICAgICAgWzMwLCAtMTIwX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AgCiAgICAgICAgICAgIAogICAgICAgIAo8L3NjcmlwdD4=\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7f29efdb45c0>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = folium.Map([43, -100], zoom_start=4)\n",
    "\n",
    "popup = folium.Popup()\n",
    "folium.Vega(scatter_chart, height=350, width=650).add_to(popup)\n",
    "folium.Marker([30, -120], popup=popup).add_to(m)\n",
    "\n",
    "# Let's create a Vega popup based on scatter_json.\n",
    "popup = folium.Popup(max_width=0)\n",
    "folium.Vega(scatter_json, height=350, width=650).add_to(popup)\n",
    "folium.Marker([30, -100], popup=popup).add_to(m)\n",
    "\n",
    "# Let's create a Vega popup based on scatter_dict.\n",
    "popup = folium.Popup(max_width=650)\n",
    "folium.Vega(scatter_dict, height=350, width=650).add_to(popup)\n",
    "folium.Marker([30, -80], popup=popup).add_to(m)\n",
    "\n",
    "m.save(os.path.join('results', 'vega_popups.html'))\n",
    "\n",
    "m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Fancy HTML popup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD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0iZm9saXVtLW1hcCIgaWQ9Im1hcF85Mzk2NjQ2MGU3YzU0ODFiYWU2YTc3ZDNhMjQzNjRmNCIgPjwvZGl2Pgo8L2JvZHk+CjxzY3JpcHQ+ICAgIAogICAgCiAgICAKICAgICAgICB2YXIgYm91bmRzID0gbnVsbDsKICAgIAoKICAgIHZhciBtYXBfOTM5NjY0NjBlN2M1NDgxYmFlNmE3N2QzYTI0MzY0ZjQgPSBMLm1hcCgKICAgICAgICAnbWFwXzkzOTY2NDYwZTdjNTQ4MWJhZTZhNzdkM2EyNDM2NGY0JywgewogICAgICAgIGNlbnRlcjogWzQzLCAtMTAwXSwKICAgICAgICB6b29tOiA0LAogICAgICAgIG1heEJvdW5kczogYm91bmRzLAogICAgICAgIGxheWVyczogW10sCiAgICAgICAgd29ybGRDb3B5SnVtcDogZmFsc2UsCiAgICAgICAgY3JzOiBMLkNSUy5FUFNHMzg1NywKICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICB9KTsKCgogICAgCiAgICB2YXIgdGlsZV9sYXllcl8yNDNkZDNhODY5NjE0NTNiODlmNDJlMzYyZWJjNGQzOCA9IEwudGlsZUxheWVyKAogICAgICAgICdodHRwczovL3tzfS50aWxlLm9wZW5zdHJlZXRtYXAub3JnL3t6fS97eH0ve3l9LnBuZycsCiAgICAgICAgewogICAgICAgICJhdHRyaWJ1dGlvbiI6IG51bGwsCiAgICAgICAgImRldGVjdFJldGluYSI6IGZhbHNlLAogICAgICAgICJtYXhOYXRpdmVab29tIjogMTgsCiAgICAgICAgIm1heFpvb20iOiAxOCwKICAgICAgICAibWluWm9vbSI6IDAsCiAgICAgICAgIm5vV3JhcCI6IGZhbHNlLAogICAgICAgICJvcGFjaXR5IjogMSwKICAgICAgICAic3ViZG9tYWlucyI6ICJhYmMiLAogICAgICAgICJ0bXMiOiBmYWxzZQp9KS5hZGRUbyhtYXBfOTM5NjY0NjBlN2M1NDgxYmFlNmE3N2QzYTI0MzY0ZjQpOwogICAgCiAgICAgICAgdmFyIG1hcmtlcl9hYTU0OGE5Njg5OTU0MGNkYjcxNzc1ZDIyNTgwYWM2ZiA9IEwubWFya2VyKAogICAgICAgICAgICBbMzAsIC0xMDBdLAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpY29uOiBuZXcgTC5JY29uLkRlZmF1bHQoKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApLmFkZFRvKG1hcF85Mzk2NjQ2MGU3YzU0ODFiYWU2YTc3ZDNhMjQzNjRmNCk7CiAgICAgICAgCiAgICAKICAgICAgICAgICAgdmFyIHBvcHVwXzFkZTJiZDQ3MjJmNDQyNzA5OGU3YjViZjRhYjhkMWVhID0gTC5wb3B1cCh7bWF4V2lkdGg6ICcxMDAlJwogICAgICAgICAgICAKICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAKICAgICAgICAgICAgICAgIHZhciBodG1sXzViOWY0NzQyOThkMTQ5YTVhNTgyYmNlYTFkZTJmZDhiID0gJChgPGRpdiBpZD0iaHRtbF81YjlmNDc0Mjk4ZDE0OWE1YTU4MmJjZWExZGUyZmQ4YiIgc3R5bGU9IndpZHRoOiAxMDAuMCU7IGhlaWdodDogMTAwLjAlOyI+ICAgICA8aDE+IFRoaXMgaXMgYSBiaWcgcG9wdXA8L2gxPjxicj4gICAgIFdpdGggYSBmZXcgbGluZXMgb2YgY29kZS4uLiAgICAgPHA+ICAgICA8Y29kZT4gICAgICAgICBmcm9tIG51bXB5IGltcG9ydCAqPGJyPiAgICAgICAgIGV4cCgtMipwaSkgICAgIDwvY29kZT4gICAgIDwvcD4gICAgIDwvZGl2PmApWzBdOwogICAgICAgICAgICAgICAgcG9wdXBfMWRlMmJkNDcyMmY0NDI3MDk4ZTdiNWJmNGFiOGQxZWEuc2V0Q29udGVudChodG1sXzViOWY0NzQyOThkMTQ5YTVhNTgyYmNlYTFkZTJmZDhiKTsKICAgICAgICAgICAgCgogICAgICAgICAgICBtYXJrZXJfYWE1NDhhOTY4OTk1NDBjZGI3MTc3NWQyMjU4MGFjNmYuYmluZFBvcHVwKHBvcHVwXzFkZTJiZDQ3MjJmNDQyNzA5OGU3YjViZjRhYjhkMWVhKQogICAgICAgICAgICA7CgogICAgICAgICAgICAKICAgICAgICAKPC9zY3JpcHQ+\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7f29efe5b668>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import branca\n",
    "\n",
    "\n",
    "m = folium.Map([43, -100], zoom_start=4)\n",
    "\n",
    "html = \"\"\"\n",
    "    <h1> This is a big popup</h1><br>\n",
    "    With a few lines of code...\n",
    "    <p>\n",
    "    <code>\n",
    "        from numpy import *<br>\n",
    "        exp(-2*pi)\n",
    "    </code>\n",
    "    </p>\n",
    "    \"\"\"\n",
    "\n",
    "\n",
    "folium.Marker([30, -100], popup=html).add_to(m)\n",
    "\n",
    "m.save(os.path.join('results', 'html_popups.html'))\n",
    "\n",
    "m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can also put any HTML code inside of a Popup, thaks to the `IFrame` object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4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Zm9saXVtLW1hcCIgaWQ9Im1hcF8zNDk2YjljZTgxZmM0YTk1YTFlNGQ4ZjQzMGY0MmJiNyIgPjwvZGl2Pgo8L2JvZHk+CjxzY3JpcHQ+ICAgIAogICAgCiAgICAKICAgICAgICB2YXIgYm91bmRzID0gbnVsbDsKICAgIAoKICAgIHZhciBtYXBfMzQ5NmI5Y2U4MWZjNGE5NWExZTRkOGY0MzBmNDJiYjcgPSBMLm1hcCgKICAgICAgICAnbWFwXzM0OTZiOWNlODFmYzRhOTVhMWU0ZDhmNDMwZjQyYmI3JywgewogICAgICAgIGNlbnRlcjogWzQzLCAtMTAwXSwKICAgICAgICB6b29tOiA0LAogICAgICAgIG1heEJvdW5kczogYm91bmRzLAogICAgICAgIGxheWVyczogW10sCiAgICAgICAgd29ybGRDb3B5SnVtcDogZmFsc2UsCiAgICAgICAgY3JzOiBMLkNSUy5FUFNHMzg1NywKICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICB9KTsKCgogICAgCiAgICB2YXIgdGlsZV9sYXllcl9lMTNlMzNmMGU1YTk0NGNmYTc2M2Y1ZjUxMjQyN2RmNiA9IEwudGlsZUxheWVyKAogICAgICAgICdodHRwczovL3tzfS50aWxlLm9wZW5zdHJlZXRtYXAub3JnL3t6fS97eH0ve3l9LnBuZycsCiAgICAgICAgewogICAgICAgICJhdHRyaWJ1dGlvbiI6IG51bGwsCiAgICAgICAgImRldGVjdFJldGluYSI6IGZhbHNlLAogICAgICAgICJtYXhOYXRpdmVab29tIjogMTgsCiAgICAgICAgIm1heFpvb20iOiAxOCwKICAgICAgICAibWluWm9vbSI6IDAsCiAgICAgICAgIm5vV3JhcCI6IGZhbHNlLAogICAgICAgICJvcGFjaXR5IjogMSwKICAgICAgICAic3ViZG9tYWlucyI6ICJhYmMiLAogICAgICAgICJ0bXMiOiBmYWxzZQp9KS5hZGRUbyhtYXBfMzQ5NmI5Y2U4MWZjNGE5NWExZTRkOGY0MzBmNDJiYjcpOwogICAg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dXBfOTdjMmQ4MDUxMDY3NDdlZGFmMjFlMTIxMjc0Y2MyNjcuc2V0Q29udGVudChpX2ZyYW1lXzBkNzkzZTYwM2NhMTQzNzZhOWYwZjQ1MDQ3ODBhYjQ2KTsKICAgICAgICAgICAgCgogICAgICAgICAgICBtYXJrZXJfMmI0ODM3OTQyY2Y2NDUxMWIyMmNlM2JkOWM1NmI5MDcuYmluZFBvcHVwKHBvcHVwXzk3YzJkODA1MTA2NzQ3ZWRhZjIxZTEyMTI3NGNjMjY3KQogICAgICAgICAgICA7CgogICAgICAgICAgICAKICAgICAgICAKPC9zY3JpcHQ+\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7f29efd73cf8>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m = folium.Map([43, -100], zoom_start=4)\n",
    "\n",
    "html = \"\"\"\n",
    "    <h1> This popup is an Iframe</h1><br>\n",
    "    With a few lines of code...\n",
    "    <p>\n",
    "    <code>\n",
    "        from numpy import *<br>\n",
    "        exp(-2*pi)\n",
    "    </code>\n",
    "    </p>\n",
    "    \"\"\"\n",
    "\n",
    "iframe = branca.element.IFrame(html=html, width=500, height=300)\n",
    "popup = folium.Popup(iframe, max_width=500)\n",
    "\n",
    "folium.Marker([30, -100], popup=popup).add_to(m)\n",
    "\n",
    "m.save(os.path.join('results', 'html_popups.html'))\n",
    "\n",
    "m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIg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gICAgICBoZWlnaHQ6IDEwMC4wJTsKICAgICAgICBsZWZ0OiAwLjAlOwogICAgICAgIHRvcDogMC4wJTsKICAgICAgICB9CiAgICA8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5PiAgICAKICAgIAogICAgPGRpdiBjbGFzcz0iZm9saXVtLW1hcCIgaWQ9Im1hcF9jYmFlMjVkODlmMGM0ZDc4OTQxZDRlOGMyYjk3ZjE5NSIgPjwvZGl2Pgo8L2JvZHk+CjxzY3JpcHQ+ICAgIAogICAgCiAgICAKICAgICAgICB2YXIgYm91bmRzID0gbnVsbDsKICAgIAoKICAgIHZhciBtYXBfY2JhZTI1ZDg5ZjBjNGQ3ODk0MWQ0ZThjMmI5N2YxOTUgPSBMLm1hcCgKICAgICAgICAnbWFwX2NiYWUyNWQ4OWYwYzRkNzg5NDFkNGU4YzJiOTdmMTk1JywgewogICAgICAgIGNlbnRlcjogWzQzLCAtMTAwXSwKICAgICAgICB6b29tOiA0LAogICAgICAgIG1heEJvdW5kczogYm91bmRzLAogICAgICAgIGxheWVyczogW10sCiAgICAgICAgd29ybGRDb3B5SnVtcDogZmFsc2UsCiAgICAgICAgY3JzOiBMLkNSUy5FUFNHMzg1NywKICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICB9KTsKCgogICAgCiAgICB2YXIgdGlsZV9sYXllcl9mODA2MDUyNWZkYjY0NmEwYjJlZWU2ZWQ5Mjk5YTU4OSA9IEwudGlsZUxheWVyKAogICAgICAgICdodHRwczovL3tzfS50aWxlLm9wZW5zdHJlZXRtYXAub3JnL3t6fS97eH0ve3l9LnBuZycsCiAgICAgICAgewogICAgICAgICJhdHRyaWJ1dGlvbiI6IG51bGwsCiAgICAgICAgImRldGVjdFJldGluYSI6IGZhbHNlLAogICAgICAgICJtYXhOYXRpdmVab29tIjogMTgsCiAgICAgICAgIm1heFpvb20iOiAxOCwKICAgICAgICAibWluWm9vbSI6IDAsCiAgICAgICAgIm5vV3JhcCI6IGZhbHN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x0aD5kb2dzPC90aD4gICAgIDwvdHI+ICAgPC90aGVhZD4gICA8dGJvZHk+ICAgICA8dHI+ICAgICAgIDx0aD4wPC90aD4gICAgICAgPHRkPmFwcGxlPC90ZD4gICAgICAgPHRkPm9yYW5nZXM8L3RkPiAgICAgPC90cj4gICAgIDx0cj4gICAgICAgPHRoPjE8L3RoPiAgICAgICA8dGQ+b3RoZXI8L3RkPiAgICAgICA8dGQ+c3R1ZmY8L3RkPiAgICAgPC90cj4gICA8L3Rib2R5PiA8L3RhYmxlPjwvZGl2PmApWzBdOwogICAgICAgICAgICAgICAgcG9wdXBfYTIwMmEwZDU5ZjhjNDcxMWI0NzJhMTI0YzcxN2QyNGIuc2V0Q29udGVudChodG1sXzk4N2UxNGYyNjM4YTQ5MzE5ODRhNGZjZGZiNWU5M2JkKTsKICAgICAgICAgICAgCgogICAgICAgICAgICBtYXJrZXJfMDMxZWQ4MjhjNzY2NDg0NmE1YmY1ODBlMTczN2QyMmEuYmluZFBvcHVwKHBvcHVwX2EyMDJhMGQ1OWY4YzQ3MTFiNDcyYTEyNGM3MTdkMjRiKQogICAgICAgICAgICA7CgogICAgICAgICAgICAKICAgICAgICAKPC9zY3JpcHQ+\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7f29efd55198>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df = pd.DataFrame(data=[['apple', 'oranges'], ['other', 'stuff']], columns=['cats', 'dogs'])\n",
    "\n",
    "m = folium.Map([43, -100], zoom_start=4)\n",
    "\n",
    "html = df.to_html(classes='table table-striped table-hover table-condensed table-responsive')\n",
    "\n",
    "popup = folium.Popup(html)\n",
    "\n",
    "folium.Marker([30, -100], popup=popup).add_to(m)\n",
    "\n",
    "m.save(os.path.join('results', 'html_popups.html'))\n",
    "\n",
    "m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that you can put another `Figure` into an `IFrame` ; this should let you do stange things..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2xlYWZsZXRAMS4zLjQvZGlzdC9sZWFmbGV0LmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2FqYXguZ29vZ2xlYXBpcy5jb20vYWpheC9saWJzL2pxdWVyeS8xLjExLjEvanF1ZXJ5Lm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6Ly9tYXhjZG4uYm9vdHN0cmFwY2RuLmNvbS9ib290c3RyYXAvMy4yLjAvanMvYm9vdHN0cmFwLm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6Ly9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvTGVhZmxldC5hd2Vzb21lLW1hcmtlcnMvMi4wLjIvbGVhZmxldC5hd2Vzb21lLW1hcmtlcnMuanMiPjwvc2NyaXB0PgogICAgPGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBocmVmPSJod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k0YWZhMDIyOWFkZGRlZjA3ZCA9IEwudGlsZUxheWVyKAogICAgICAgICdodHRwczovL3tzfS50aWxlLm9wZW5zdHJlZXRtYXAub3JnL3t6fS97eH0ve3l9LnBuZycsCiAgICAgICAgewogICAgICAgICJhdHRyaWJ1dGlvbiI6IG51bGwsCiAgICAgICAgImRldGVjdFJldGluYSI6IGZhbHNlLAogICAgICAgICJtYXhOYXRpdmVab29tIjogMTgsCiAgICAgICAgIm1heFpvb20iOiAxOCwKICAgICAgICAibWluWm9vbSI6IDAsCiAgICAgICAgIm5vV3JhcCI6IGZhbHNlLAogICAgICAgICJvcGFjaXR5IjogMSwKICAgICAgICAic3ViZG9tYWlucyI6ICJhYmMiLAogICAgICAgICJ0bXMiOiBmYWxzZQp9KS5hZGRUbyhtYXBfMGRiMjA2YjNhNmExNDlmNmFjYjUyM2UwMTE5ZTQ1MTUpOwogICAgCiAgICAgICAgdmFyIG1hcmtlcl83YzE4MzkxMTBmNjc0NTdjOWU0ZjQ5OGZkOWY2ZGJmZCA9IEwubWFya2VyKAogICAgICAgICAgICBbMzAsIC0xMDBdLAogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpY29uOiBuZXcgTC5JY29uLkRlZmF1bHQoKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApLmFkZFRvKG1hcF8wZGIyMDZiM2E2YTE0OWY2YWNiNTIzZTAxMTllNDUxNSk7CiAgICAgICAgCiAgICAKICAgICAgICAgICAgdmFyIHBvcHVwX2I2N2VlNDBjYmJmMDQzNzQ4YTJlMDJkZmM5MGIxYTQzID0gTC5wb3B1cCh7bWF4V2lkdGg6ICcyNjUwJwogICAgICAgICAgICAKICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAKICAgICAgICAgICAgICAgIHZhciBpX2ZyYW1lXzdmNWMwYmE4OThkNTRkMDJhMTIwN2EwMjJhMmQ0YmE4ID0gJChgPGlmcmFtZSBzcmM9ImRhdGE6dGV4dC9odG1sO2NoYXJzZXQ9dX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\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7f29efd308d0>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Let's create a Figure, with a map inside.\n",
    "f = branca.element.Figure()\n",
    "folium.Map([-25, 150], zoom_start=3).add_to(f)\n",
    "\n",
    "# Let's put the figure into an IFrame.\n",
    "iframe = branca.element.IFrame(width=500, height=300)\n",
    "f.add_to(iframe)\n",
    "\n",
    "# Let's put the IFrame in a Popup\n",
    "popup = folium.Popup(iframe, max_width=2650)\n",
    "\n",
    "# Let's create another map.\n",
    "m = folium.Map([43, -100], zoom_start=4)\n",
    "\n",
    "# Let's put the Popup on a marker, in the second map.\n",
    "folium.Marker([30, -100], popup=popup).add_to(m)\n",
    "\n",
    "# We get a map in a Popup. Not really useful, but powerful.\n",
    "m.save(os.path.join('results', 'map_popups.html'))\n",
    "\n",
    "m"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
